package teaching.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import teaching.pojo.User;

import java.util.List;

/**
 * Author:20201002983_郑雨蓓
 * Date: 2024/3/2
 * Description:
 */

public interface UserMapper extends BaseMapper<User> {
    @Select("select * from user")
    List<User> listAllUsers();

    @Select("select * from user where username = #{username}")
    User findByUserName(@Param("username") String username);

    @Select("select user.name from user where id=#{userId}")
    String findUserName(@Param("userId") long userId);
}
